#include <cstdlib>
#include <string>
#include <vector>
#include <iostream>

int main()
{
    std::cout << "=== Running All Tests ===" << std::endl;
    
    int totalFailed = 0;
    
    // 运行所有测试
    std::vector<std::string> testPrograms = {
        "test_bash",
        "test_file",
        "test_log",
        "test_timer",
        "test_param",
        "test_image"
    };
    
    for (const auto& test : testPrograms) {
        std::cout << "\n--- Running " << test << " ---" << std::endl;
        std::string cmd = "./" + test;
        int ret = std::system(cmd.c_str());
        if (ret != 0) {
            totalFailed++;
            std::cerr << "Test " << test << " failed!" << std::endl;
        }
    }
    
    std::cout << "\n=== Overall Test Results ===" << std::endl;
    std::cout << "Total test suites: " << testPrograms.size() << std::endl;
    std::cout << "Failed test suites: " << totalFailed << std::endl;
    
    return totalFailed == 0 ? 0 : 1;
}

